home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 29
/
Volume 29 - JOGO DISK .iso
/
Games
/
little_soldiers.swf
/
scripts
/
frame_25
/
DoAction.as
< prev
Wrap
Text File
|
2006-11-29
|
6KB
|
240 lines
function remove1(force)
{
if(force)
{
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
addBoom(this.x,this.y,0);
this.removeMovieClip("");
}
}
function remove2(force)
{
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
addBoom(this.x,this.y,0);
this.removeMovieClip("");
}
function linker(num)
{
num;
this.countdown = num++;
if(num % 4 == 0)
{
this.sp = true;
}
if(map[this.y][this.x + 1].t == 3 && map[this.y][this.x + 1].countdown == -1)
{
map[this.y][this.x + 1].linker(num);
}
if(map[this.y][this.x - 1].t == 3 && map[this.y][this.x - 1].countdown == -1)
{
map[this.y][this.x - 1].linker(num);
}
if(map[this.y + 1][this.x].t == 3 && map[this.y + 1][this.x].countdown == -1)
{
map[this.y + 1][this.x].linker(num);
}
if(map[this.y - 1][this.x].t == 3 && map[this.y - 1][this.x].countdown == -1)
{
map[this.y - 1][this.x].linker(num);
}
this.onEnterFrame = linkerDie;
}
function remove3(force)
{
this.linker(1);
}
function frame3()
{
if(this.countdown > 0)
{
return 1;
}
}
function linkerDie()
{
if(this.countdown > 0)
{
this.countdown = this.countdown - 1;
if(this.countdown == 0)
{
if(this.sp || random(4) == 2)
{
var _loc3_ = soundBoard.newSound("sLinker");
_loc3_.stop();
if(sounds)
{
_loc3_.start(0,0);
}
}
var _loc2_ = fg.attachMovie("boomlinker","boom_" + this.y + "_" + this.x,w * h + this.y * w + this.x);
_loc2_._x = this.x * tw - tw / 2;
_loc2_._y = this.y * th - th / 2;
_loc2_.onEnterFrame = function()
{
if(this._currentframe == this._totalframes)
{
this.removeMovieClip("");
}
};
smap[this.y][this.x] = 0;
map[this.y][this.x] = 0;
this.removeMovieClip("");
}
return 1;
}
}
function remove4()
{
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
addBoom(this.x,this.y,1);
smap[this.y - 1][this.x].remove(true);
smap[this.y][this.x - 1].remove(true);
smap[this.y][this.x + 1].remove(true);
smap[this.y + 1][this.x].remove(true);
this.removeMovieClip("");
}
function frame5()
{
if(map[this.y + 1][this.x] == 0)
{
if(smap[this.y + 1][this.x])
{
smap[this.y + 1][this.x].remove(false);
}
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
map[this.y + 1][this.x] = this;
smap[this.y + 1][this.x] = this;
this.y = this.y + 1;
var _loc2_ = map[this.y + 1][this.x].t;
if(_loc2_ == 4 || _loc2_ == 7)
{
map[this.y + 1][this.x].remove(false);
}
this.onEnterFrame = function()
{
this._y += tw / 3;
};
return 1;
}
this.onEnterFrame = null;
}
function frame7()
{
if(map[this.y + 1][this.x] == 0)
{
if(smap[this.y + 1][this.x])
{
smap[this.y + 1][this.x].remove(false);
return undefined;
}
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
map[this.y + 1][this.x] = this;
smap[this.y + 1][this.x] = this;
this.y = this.y + 1;
soundBoard.start("sFall",0,0);
this.fall = true;
this.onEnterFrame = function()
{
this._y += tw / 3;
};
return 1;
}
if(this.fall)
{
this.remove(false);
}
this.onEnterFrame = null;
}
function frame9()
{
if(map[this.y + 1][this.x] == 0)
{
if(smap[this.y + 1][this.x])
{
smap[this.y + 1][this.x].remove(false);
}
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
map[this.y + 1][this.x] = this;
smap[this.y + 1][this.x] = this;
this.y = this.y + 1;
var _loc2_ = map[this.y + 1][this.x].t;
if(_loc2_ == 4 || _loc2_ == 7)
{
map[this.y + 1][this.x].remove(false);
}
if(random(2))
{
soundBoard.start("sFall",0,0);
}
this.onEnterFrame = function()
{
if(this._y < th * this.y - 1)
{
this._y += th / 3;
}
};
return 1;
}
if(map[this.y + 1][this.x + 1] == 0 && map[this.y][this.x + 1] == 0)
{
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
map[this.y][this.x + 1] = this;
smap[this.y][this.x + 1] = this;
this.x = this.x + 1;
this.onEnterFrame = function()
{
if(this._x < tw * this.x - 1)
{
this._x += tw / 3;
}
};
return 32;
}
if(map[this.y + 1][this.x - 1] == 0 && map[this.y][this.x - 1] == 0)
{
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
map[this.y][this.x - 1] = this;
smap[this.y][this.x - 1] = this;
this.x = this.x - 1;
this.onEnterFrame = function()
{
if(this._x > tw * this.x + 1)
{
this._x -= tw / 3;
}
};
return 1;
}
this.onEnterFrame = null;
}
sounds = true;
remove5 = remove2;
remove6 = remove2;
remove7 = remove4;
remove8 = function()
{
smap[this.y][this.x] = 0;
addBoom(this.x,this.y,2);
smap[this.y - 1][this.x - 1].remove(true);
smap[this.y - 1][this.x].remove(true);
smap[this.y - 1][this.x + 1].remove(true);
smap[this.y][this.x - 1].remove(true);
smap[this.y][this.x + 1].remove(true);
smap[this.y + 1][this.x - 1].remove(true);
smap[this.y + 1][this.x].remove(true);
smap[this.y + 1][this.x + 1].remove(true);
this.removeMovieClip("");
};
remove9 = remove2;
remove10 = remove2;
frame10 = frame5;
remove11 = remove2;